package rs.dalao.syc.index.service.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import rs.dalao.syc.common.pojo.vo.PageData;
import rs.dalao.syc.index.dao.persist.repository.IVideoRepository;
import rs.dalao.syc.index.pojo.vo.VideoDetailVO;
import rs.dalao.syc.index.pojo.vo.VideoVO;
import rs.dalao.syc.index.service.IVideoService;

import java.util.List;

@Service
public class VideoServiceImpl implements IVideoService {

    @Value("${syc.dao.default-query-page-size}")
    private Integer defaultQueryPageSize;

    @Autowired
    private IVideoRepository videoRepository;

    //遍历所有的视频，拿到科普视频表里面的所有信息
    @Override
    public PageData<VideoVO> listVideo(Integer pageNum) {
        return videoRepository.listVideo(pageNum, defaultQueryPageSize);
    }

    @Override
    public PageData<VideoVO> listVideo(Integer pageNum, Integer pageSize) {
        return videoRepository.listVideo(pageNum, pageSize);
    }

    @Override
    public VideoDetailVO selectVideoById(Long id){
        return videoRepository.selectVideoById(id);
    }
}
